<?php
require('config.php');

if($pathinfo){
	$xmldb = new xmldb('blog'.$pathinfo) or die('cannot import class xmldb!');
	$tm->assign($xmldb->getxmldb());
	$tm->display('show');
}else{
	$pagenum = @$_GET['pn'];
	$blogs = ht_import('blog') or die('cannot import class blog!');
	$tm->assign('blogs', $blogs->getblogs($pagenum));
	$tm->assign('total', $blogs->total);
	$tm->assign('pagecnt', $blogs->pagecnt);
	$tm->assign('pagenum', $blogs->pagenum);
	$tm->assign('pagestart', $blogs->pagestart);
	$tm->assign('pageend', $blogs->pageend);
	$tm->display('blog');
}
?>